void main() {
  // 创建男人对象
  Man man = Man('李雷', 13);
  print(man.name);
  man.eat();
  man.sing();
  man.KungFu(man.name);

  // 创建女人对象
  Woman woman = Woman('韩梅梅', 14);
  print(woman.name);
  woman.eat();
  woman.dance(woman.name);

}

mixin KungFuMixin {
  void KungFu(name){
    print('$name喜欢武术');
  }
}

mixin DanceMixin {
  void dance(name) {
    print('$name喜欢跳舞');
  }
}

/// 人类
class Person {
  Person(this.name, this.age);

  String? name;
  int? age;

  void eat() {
    print('$name -- eat');
  }
}

/// 男人类
class Man extends Person with KungFuMixin{
  // 定义子类构造函数
  Man(super.name, super.age);

  // 唱歌的方法
  void sing() {
    print('$name -- 爱唱歌');
  }
}

/// 女人类
class Woman extends Person with DanceMixin{
  // 定义子类构造函数
  Woman(super.name, super.age);
}